package dungeonTools;

import be.kuleuven.cs.som.annotate.*;

/**
 * An enumeration introducing different directions for borders or bordering squares.
 * There are six directions: north, east, south, west, ceiling and floor.
 * 
 * @author Tom Jacobs & Ewoud De Moor
 * @version 3.0
 */
@Value
public enum Direction {
	NORTH, EAST, SOUTH, WEST, CEILING, FLOOR;
	
	/**
	 * @return The opposite direction of a given square.
	 */
	@Immutable
	public Direction getOppositeDirection() throws IllegalStateException{
		switch(this){
		case NORTH:
			return Direction.SOUTH;
		case SOUTH:
			return Direction.NORTH;
		case EAST:
			return Direction.WEST;
		case WEST:
			return Direction.EAST;
		case CEILING:
			return Direction.FLOOR;
		case FLOOR:
			return Direction.CEILING;
		}
		throw new IllegalStateException();
	}
}
